using System;
using System.Web.Mvc;
using Newtonsoft.Json;

namespace Plain.Demo.Blog.Web
{
	public class PlainJsonResult : ActionResult
	{
	    /// <summary>
	    /// The result object to render using JSON.
	    /// </summary>
	    public object Data { get; set; }
	 
	    public override void ExecuteResult(ControllerContext context)
	    {
	        context.HttpContext.Response.ContentType = "application/json";
	 
	        JsonSerializer serializer = new JsonSerializer();
	        serializer.Serialize(context.HttpContext.Response.Output, this.Data);
	    }
	}
}